package main

import (
	"fmt"
	"strings"
)

func main() {
	var str1 string = "hello你好"
	fmt.Printf("str1 %v, type %T, size %d\n", str1, str1, len(str1))

	var str2 string = "hello\n你好\\dfjdfdfj\"dfdsfsd"
	fmt.Println(str2)

	var str3 = `dfdfds
fdsfsdfsd
dfdeer`
	fmt.Println(str3)

	var str4 string = "hello,你好，"
	fmt.Println(len(str4))

	str5 := fmt.Sprintf("%v - %v", "hello", "陈浩杰")
	fmt.Println(str5)

	split := strings.Split("hello,world", ",")
	fmt.Printf("split=%v, type=%T\n", split, split)
	join := strings.Join(split, "=")
	fmt.Println(join)

	str6 := "chenhaojie"
	contains := strings.Contains(str6, "hao")
	index := strings.Index(str6, "zy")
	index1 := strings.LastIndex(str6, "h")
	fmt.Println(contains, index, index1)

	str7 := "chj.png"
	suffix := strings.HasSuffix(str7, "png")
	prefix := strings.HasPrefix(str7, "png")
	fmt.Println(suffix, prefix)
}
